﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" MasterPageFile="~/Site.Master"
    Inherits="mal.balades.Web.VisitProvence._default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js"></script>
    <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
    <!-- Datas -->
    <script src="/VisitProvence/js/Datas/OpenDataBase.min.js"></script>
    <script src="/VisitProvence/js/Datas/MonumentData.min.js"></script>
    <script src="/VisitProvence/js/Datas/HotelData.min.js"></script>
    <script src="/VisitProvence/js/Datas/NaturalSiteData.min.js"></script>
    <!-- Services -->
    <script src="/VisitProvence/js/Services/OpenDataService.min.js"></script>
    <script src="/VisitProvence/js/Services/BeachService.min.js"></script>
    <script src="/VisitProvence/js/Services/MeseumService.min.js"></script>
    <script src="/VisitProvence/js/Services/MonumentService.min.js"></script>
    <script src="/VisitProvence/js/Services/NaturalSiteService.min.js"></script>
    <script src="/VisitProvence/js/Services/HotelService.min.js"></script>
    <script src="/VisitProvence/js/Services/ResidencesDeTourismeService.min.js"></script>
    <script src="/VisitProvence/js/Services/ChambresDHotesService.min.js"></script>
    <!-- Core -->
    <script src="/VisitProvence/js/CategoryViewModel.min.js"></script>
    <script src="/VisitProvence/js/DataTypeViewModel.min.js"></script>
    <script src="/VisitProvence/js/main.min.js"></script>
    <script>
        var main;

        $(document).ready(function () {
            main = new Main();
            var services = [];
            services.push(new HotelService());
            services.push(new ResidencesDeTourismeService());
            services.push(new ChambresDHotesService());

            main.load(services);
            ko.applyBindings(main);
        });
    </script>
    <link href="/VisitProvence/style.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        Hébergement
    </h1>
    <p>
        Grâce au département des Bouches-du-Rhône, nous vous proposons ici une liste d'hotels,
        résidences de vacances et chambres d'hôtes.
    </p>
    <div data-bind="foreach:categories" id="filters">
        <div data-bind="visible:types().length>0"
            class="categories">
            <div data-bind="click:onClick,css:{filterSelected: isSelected()==true, filter:isSelected()==false}">
                <span  class="category">Tous</span>(<span data-bind="text:count"></span>)
            </div>
            <div data-bind="foreach:types" style="width: 180px" class="typesContainer">
                <div data-bind="click:onClick,css:{filterSelected: isSelected()==true, filter:isSelected()==false}" >
                    <span data-bind="html:name" class="type"></span>(<span data-bind="text:count"></span>)
                </div>
            </div>
        </div>
    </div>
    <div id="mapContainer">
        <div id="map">
        </div>
        <div id="mapOverlayContainer" data-bind="visible:popupVisible">
            <div id="mapMoverlay">
            </div>
            <div id="mapPopupContainer">
                <div id="mapPopup" data-bind="template:{name:function(){return main.getTemplateName();}, data:selectedData}">
                </div>
                <div id="mapPopupClose" data-bind="click:closePopup">
                    <a href="javascript;">Fermer</a>
                </div>
            </div>
        </div>
    </div>
    <script type="text/html" id="empty">
    </script>
    <script type="text/html" id="OpenDataBase">
        <div>
            <h2 data-bind="text: raisonSociale"></h2>

            <h3 data-bind="text:type"></h3>
        </div>
    </script>
    <script type="text/html" id="MonumentData">
        <div>
            <h2 data-bind="text: raisonSociale"></h2>

            <h3 data-bind="text:sousType"></h3>

            <div data-bind="visible:getAddress()!=''">
                adresse : <span data-bind="html:getAddress()"></span>
            </div>

            <div data-bind="visible:adresseWeb!=''">
                site web : <a data-bind="text:adresseWeb,attr:{'href':adresseWeb}" target="_blank"></a>
            </div>
            <div data-bind="visible:telephone!=''">
                tel: <span data-bind="text:telephone" />
            </div>
            <div data-bind="visible:mail!=''">
                mail: <a data-bind="text:mail,attr:{'href':'mailto:'+mail}"></a>
            </div>
        </div>
    </script>
    <script type="text/html" id="NaturalSiteData">
        <div>
            <h2 data-bind="text: raisonSociale"></h2>

            <h3 data-bind="text:sousType"></h3>

            <div data-bind="visible:adresseWeb!=''">
                adresse : <a data-bind="text:adresseWeb,attr:{'href':adresseWeb}"></a>
            </div>
        </div>
    </script>
</asp:Content>
